import java.util.Scanner;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
            int n = in.nextInt();
            in.nextLine();//尤其是这里需要注意,避免对后续nextLine造成影响
            for (int i = 0; i < n; i++) {
                String str = in.nextLine();
                if(str.contains(",") || str.contains(" ")){
                    System.out.print("\""+str+"\"");
                }else{
                    System.out.print(str);
                }
                if(i != n-1){
                    System.out.print(", ");
                }
            }
            System.out.println();
        }
    }
}